﻿namespace TC
{
    public class GetPosition_blueprint : TranslateBlueprint
    {
        public override editor.cfg.blueprint.Node OnTranslate(Node node)
        {
            GetPosition t = node as GetPosition;
            editor.cfg.blueprint.GetPosition re = new editor.cfg.blueprint.GetPosition();
            re.id = t.id;

            Port p = t.graph.GetConnect(t.gameObject);
            if(p == null)
            {
                throw new System.Exception("GetPosition self is null...");
            }

            re.self = new editor.cfg.blueprint.OutputPin() { nodeId = p.parent.id, pinName = p.name };
            re.output = t.position.name;

            return re;
        }
    }
}
